﻿using NPOI.XWPF.UserModel;
using System;
using System.IO;
using NPOI.OpenXml4Net.OPC;

namespace WordAPptAExcelToHtml.ExportDemo
{
    public class ReadWord
    {
        public static string ReadWordConent()
        {
            var root = System.AppDomain.CurrentDomain.BaseDirectory;
            var input = new StreamReader(Path.Combine(root, @"templates\demo1.docx"));
            var htmlfile = Path.Combine(root, @"test.html");
            var imgurl= Path.Combine(root, @"Image");
            if (!System.IO.Directory.Exists(imgurl))
                Directory.CreateDirectory(imgurl);



            XWPFDocument document=new XWPFDocument(OPCPackage.OpenOrCreate(Path.Combine(root, @"templates\demo1.docx")));
            foreach (var paragraph in document.Paragraphs)
            {
                Console.WriteLine(paragraph);
            }

            return "";
        }
    }
}